import { ReactNode } from "react";
import Weather from "./Weather";
import { WeatherPropsType } from "./Weather/types";
import { WidgetProps, WidgetSizeType } from "./Widget/types";
import ScanQRcode from "./ScanQRcode";
import { ScanQRcodePropsType } from "./ScanQRcode/types";

export const widgets = {
  weather: {
    comp: (props: WeatherPropsType) => <Weather {...props} />,
    title: '和风天气'
  },
  scanQRcode: {
    comp: (props: ScanQRcodePropsType) => <ScanQRcode {...props} />,
    title: '扫码'
  }
}

export type WidgetsType = keyof typeof widgets

export type WidgetsPropsType = Omit<
  WeatherPropsType,
  keyof WidgetProps
>

export type SizeTypesType = Record<WidgetSizeType, ReactNode>
